
var gpu_option = {
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: []
    },
    grid: {
        top:'40',
        right: "25",
        bottom: "40",
    },
    title: {
        left: 'center',
        text: 'GPU显存(MB)'
    },
    yAxis: {
        type: 'value'
    },
    legend: {
        orient: 'horizontal',
        x: 'right',
        data: ['总显存', '可用显存', '已用显存']
    },
    tooltip: {
        trigger: 'axis'
    },
    series: [
        {
            name: "总显存",
            data: [],
            type: 'line',
            showSymbol: false,
            itemStyle: {
                color: '#0e72cc'
            },
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: '#0e72cc'
                    }, {
                        offset: 1, color: '#f0f9eb'
                    }],
                    global: false
                }
            }
        },
        {
            name: "可用显存",
            data: [],
            type: 'line',
            showSymbol: false,
            itemStyle: {
                color: '#67C23A'
            },
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: '#67C23A'
                    }, {
                        offset: 1, color: '#e1f3d8'
                    }],
                    global: false
                }
            }
        },
        {
            name: "已用显存",
            data: [],
            type: 'line',
            showSymbol: false,
            itemStyle: {
                color: '#ff4683'
            },
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: '#ff4683'
                    }, {
                        offset: 1, color: '#42b983'
                    }],
                    global: false
                }
            }
        }
    ]
};

var gpu_temp_option = {
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: []
    },
    grid: {
        top:'40',
        right: "25",
        bottom: "40",
    },
    title: {
        left: 'center',
        text: 'GPU温度'
    },
    tooltip: {
        trigger: 'axis'
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name: "GPU温度",
            data: [],
            type: 'line',
            showSymbol: false,
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: 'red'
                    }, {
                        offset: 1, color: 'blue'
                    }],
                    global: false
                }
            }
        }
    ]
};

var cpu_option = {
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: []
    },
    grid: {
        top:'40',
        right: "25",
        bottom: "40",
    },
    title: {
        left: 'center',
        text: 'CPU 使用率(%)'
    },
    tooltip: {
        trigger: 'axis'
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name: "CPU 使用率(%)",
            data: [],
            type: 'line',
            showSymbol: false,
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: 'red' // 0% 处的颜色
                    }, {
                        offset: 1, color: 'blue' // 100% 处的颜色
                    }],
                    global: false // 缺省为 false
                }
            }
        }
    ]
};

var load_option = {
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: []
    },
    grid: {
        top:'40',
        right: "25",
        bottom: "40",
    },
    title: {
        left: 'center',
        text: '系统平均负载'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        orient: 'horizontal',
        x: 'right',
        data: ['load_1m', 'load_5m', 'load_15m']
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name: 'load_1m',
            type: 'line',
            stack: '总量',
            showSymbol: false,
            // 线条样式
            itemStyle: {
                color: '#67C23A'
            },
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: '#e1f3d8'
                    }, {
                        offset: 1, color: '#67C23A'
                    }],
                    global: false
                }
            },
            data: []
        },
        {
            name: 'load_5m',
            type: 'line',
            stack: '总量',
            showSymbol: false,
            itemStyle: {
                color: "#194f97"
            },
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: '#faecd8'
                    }, {
                        offset: 1, color: '#194f97'
                    }],
                    global: false
                }
            },
            data: []
        },
        {
            name: 'load_15m',
            type: 'line',
            stack: '总量',
            showSymbol: false,
            itemStyle: {
                color: '#409EFF'
            },
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: '#d9ecff'
                    }, {
                        offset: 1, color: '#409EFF'
                    }],
                    global: false
                }
            },
            data: []
        }
    ]
};

var mini_load_option = {
    xAxis: {
        show: false,
        data: []
    },
    grid: {
        left: "0",
        top: "0",
        right: "0",
        bottom: "0",
        containLabel: false
    },
    yAxis: {
        show: false,
        type: 'value'
    },
    series: [
        {
            name: 'load_1m',
            type: 'line',
            stack: '总量',
            showSymbol: false,
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: 'red'
                    }, {
                        offset: 1, color: 'blue'
                    }],
                    global: false
                }
            },
            data: []
        }
    ]
};

var mem_option = {
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: []
    },
    grid: {
        top:'40',
        right: "25",
        bottom: "40",
    },
    title: {
        left: 'center',
        text: '内存信息'
    },
    yAxis: {
        type: 'value'
    },
    tooltip: {
        trigger: 'axis'
    },
    series: [
        {
            name: "内存信息(%)",
            data: [],
            type: 'line',
            showSymbol: false,
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: 'red'
                    }, {
                        offset: 1, color: 'blue'
                    }],
                    global: false
                }
            }
        }
    ]
};

var net_option = {
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: []
    },
    grid: {
        top:'40',
        right: "25",
        bottom: "40",
    },
    title: {
        left: 'center',
        text: '网络负载'
    },
    yAxis: {
        type: 'value'
    },
    legend: {
        orient: 'horizontal',
        x: 'right',
        data: ['上行带宽(B/s)', '下行带宽(B/s)']
    },
    tooltip: {
        trigger: 'axis'
    },
    series: [
        {
            name: "上行带宽(B/s)",
            data: [],
            type: 'line',
            showSymbol: false,
            itemStyle: {
                color: '#0e72cc'
            },
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: '#f0f9eb'
                    }, {
                        offset: 1, color: '#0e72cc'
                    }],
                    global: false
                }
            }
        },
        {
            name: "下行带宽(B/s)",
            data: [],
            type: 'line',
            showSymbol: false,
            itemStyle: {
                color: '#67C23A'
            },
            areaStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: '#e1f3d8'
                    }, {
                        offset: 1, color: '#67C23A'
                    }],
                    global: false
                }
            }
        }
    ]
};



export default {
    gpu_option,
    gpu_temp_option,
    cpu_option,
    load_option,
    mini_load_option,
    mem_option,
    net_option
}